home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.unix.questions,comp.lang.c,comp.unix.programming
- Subject: Re: SIGBUS - What are the possible causes?
- Date: Tue, 09 Jan 96 18:58:17 GMT
- Organization: none
- Message-ID: <821213897snz@genesis.demon.co.uk>
- References: <4ct4es$3k7@news1.wolfe.net>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4ct4es$3k7@news1.wolfe.net> mcguire@wolfe.net "McGuire" writes:
-
- >Hello all,
- >
- >I am trying to compile a program under gcc 2.7.0 that works under the
- >native HP-UX 9.05 cc. In one routine I get a SIGBUS error. When I
- >ignore the SIGBUS error, I get a segmentation violation. When I add
- >some code to test what might be happening, the location at which the
- >error occurs appears to change (I am using gdb under xemacs). Does
- >anyone have any ideas as to what the possible causes of such an error
- >might be.
-
- 99% of the time you're doing something screwy with pointers. e.g.
-
- 1. Using pointer arithmetic to generate pointers outside the bounds of
- objects
-
- 2. Dereferencing an illegal pointer e.g. NULL, uninitialised, 1 past the
- end of an array, pointer to an object that has been freed, or one
- created by an illegal cast from an integer or another pointer type.
-
- 3. Passing an illegal pointer to free i.e. one not generated by
- malloc/calloc/realloc or which has already been freed.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-